<?php $this->load->view('Import/navbar');?>
<!-- Tab panes -->
<div class="tab-content" style="margin-top: 10px;">
    <div role="tabpanel" class="tab-pane" id="actionList">
        <div class="panel panel-default">
          <!-- Default panel contents -->
          <div class="panel-heading">标准动作
        <button class="btn btn-default btn-sm col-md-offset-10" role="button" onclick="newWindow('添加标准动作','<?php echo printUrl('Import','actionAdd');?>',400,500)">新增标准动作</button>
          </div>
            <form class="form-inline" action="<?php echo $this->input->server('REQUEST_URI'); ?>" method="GET">
              <input type="hidden" name="c" id="c" value="Import">
              <input type="hidden" name="m" id="m" value="actionList">
              <input type="hidden" name="tab" id="tab" value="action">
              <div class="form-group">
                <label class="" for="year">年份：</label>
                <select class="form-control" name="year" id="year">
                </select>
              </div>
              <div class="form-group">
                <label class="" for="timeUnit">双月：</label>
                <select class="form-control" name="timeUnit" id="timeUnit">
                  <option value="">选择双月</option>
                  <?php foreach ($timeUnitList as $timeK => $timeV) {?>
                  <option value="<?php echo $timeK; ?>" <?php echo $where['timeUnit']==$timeK ? ' selected="selected"' : '';?>><?php echo $timeV; ?></option>
                  <?php } ?>
                </select>
              </div>
              <div class="form-group">
                <label class="" for="type">基金类型：</label>
                <select class="form-control" name="type" id="type">
                <option value="">请选择</option>
                <option value="1" <?=$type==1?'selected="selected"':''?>>单店活动</option>
                <option value="2" <?=$type==2?'selected="selected"':''?>>专项基金</option>
                <option value="3" <?=$type==3?'selected="selected"':''?>>城市基金</option>
                </select>
              </div>
              <button type="submit" class="btn btn-default">查询</button>
            </form>
          <table class="table">
            <thead>
              <tr>
                <th class="bg-primary text-center">序号</th>
                <th class="bg-primary text-center">基金类型</th>
                <th class="bg-primary text-center">所属双月</th>
                <th class="bg-primary text-center">标准动作名称</th>
                <th class="bg-primary text-center">当前状态</th>
                <th class="bg-primary text-center">排序</th>
                <th class="bg-primary text-center">操作</th>
              </tr>
            </thead>
            <tbody>
            <?php foreach($actionList as $k => $v): ?>
              <tr>
                <td class="text-center"><?php echo $v['id']; ?></td>
                <td class="text-center"><?php echo $v['typeStr']; ?></td>
                <td class="text-center"><?php echo $v['timeUnitStr']; ?></td>
                <td class="text-center"><?php echo $v['name'];?></td>
                <td class="text-center"><?php echo $v['statusStr'];?></td>
                <td class="text-center"><?php echo $v['orderNum'];?></td>
                <td class="text-center">
                <button class="btn btn-default btn-sm" type="button" onclick="newWindow('修改标准动作','<?php echo printUrl('Import','actionEdit',array('id'=>$v['id']));?>',400,500)">修改</button>
                <button class="btn btn-default btn-sm" type="button" onclick="ajaxConfirmSubmit('您确定<?=$v['status']==1?'关闭':'开启';?>此标准动作吗？','<?=printUrl('Import','actionStatus');?>',{'id':<?=$v['id']?>})"><?=$v['status']==1?'关闭':'开启';?></button>
                </td>
              </tr>
            <?php endforeach; ?>
            </tbody>
          </table>
        </div>
    </div>
</div>
<script type="text/javascript">
  $(function(){
    loadYearList('year',<?=$year ? $year : 0?>);
    loadTimeUnitList('timeUnit',<?=$year ? $year : 0?>,<?=$timeUnit ? $timeUnit : 0?>);
  });
  $("#year").change(function(){
      loadTimeUnitList('timeUnit',this.value);
    });
</script>
<?php $this->load->view('Import/foot');?>